<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Class template velocity_verlet</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="../../../index.html" title="Chapter&#160;1.&#160;Boost.Numeric.Odeint">
<link rel="up" href="../../../header/boost/numeric/odeint/stepper/velocity_verlet_hpp.html" title="Header &lt;boost/numeric/odeint/stepper/velocity_verlet.hpp&gt;">
<link rel="prev" href="../../../header/boost/numeric/odeint/stepper/velocity_verlet_hpp.html" title="Header &lt;boost/numeric/odeint/stepper/velocity_verlet.hpp&gt;">
<link rel="next" href="../../../odeint/indexes.html" title="Indexes">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../logo.jpg"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../../../header/boost/numeric/odeint/stepper/velocity_verlet_hpp.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../header/boost/numeric/odeint/stepper/velocity_verlet_hpp.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../../odeint/indexes.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.numeric.odeint.velocity_verlet"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template velocity_verlet</span></h2>
<p>boost::numeric::odeint::velocity_verlet &#8212; The Velocity-Verlet algorithm. </p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../../header/boost/numeric/odeint/stepper/velocity_verlet_hpp.html" title="Header &lt;boost/numeric/odeint/stepper/velocity_verlet.hpp&gt;">boost/numeric/odeint/stepper/velocity_verlet.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> Coor<span class="special">,</span> <span class="keyword">typename</span> Velocity <span class="special">=</span> <span class="identifier">Coor</span><span class="special">,</span> <span class="keyword">typename</span> Value <span class="special">=</span> <span class="keyword">double</span><span class="special">,</span>
         <span class="keyword">typename</span> Acceleration <span class="special">=</span> <span class="identifier">Coor</span><span class="special">,</span> <span class="keyword">typename</span> Time <span class="special">=</span> <span class="identifier">Value</span><span class="special">,</span>
         <span class="keyword">typename</span> TimeSq <span class="special">=</span> <span class="identifier">Time</span><span class="special">,</span>
         <span class="keyword">typename</span> Algebra <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">algebra_dispatcher</span><span class="special">&lt;</span> <span class="identifier">Coor</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">algebra_type</span><span class="special">,</span>
         <span class="keyword">typename</span> Operations <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">operations_dispatcher</span><span class="special">&lt;</span> <span class="identifier">Coor</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">operations_type</span><span class="special">,</span>
         <span class="keyword">typename</span> Resizer <span class="special">=</span> <span class="identifier">initially_resizer</span><span class="special">&gt;</span>
<span class="keyword">class</span> <a class="link" href="velocity_verlet.html" title="Class template velocity_verlet">velocity_verlet</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">algebra_stepper_base</span><span class="special">&lt;</span> <span class="identifier">Algebra</span><span class="special">,</span> <span class="identifier">Operations</span> <span class="special">&gt;</span> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">algebra_stepper_base</span><span class="special">&lt;</span> <span class="identifier">Algebra</span><span class="special">,</span> <span class="identifier">Operations</span> <span class="special">&gt;</span>   <a name="boost.numeric.odeint.velocity_verlet.algebra_stepper_base_type"></a><span class="identifier">algebra_stepper_base_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">algebra_stepper_base_type</span><span class="special">::</span><span class="identifier">algebra_type</span>       <a name="boost.numeric.odeint.velocity_verlet.algebra_type"></a><span class="identifier">algebra_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">algebra_stepper_base_type</span><span class="special">::</span><span class="identifier">operations_type</span>    <a name="boost.numeric.odeint.velocity_verlet.operations_type"></a><span class="identifier">operations_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">Coor</span>                                          <a name="boost.numeric.odeint.velocity_verlet.coor_type"></a><span class="identifier">coor_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">Velocity</span>                                      <a name="boost.numeric.odeint.velocity_verlet.velocity_type"></a><span class="identifier">velocity_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">Acceleration</span>                                  <a name="boost.numeric.odeint.velocity_verlet.acceleration_type"></a><span class="identifier">acceleration_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span> <span class="identifier">coor_type</span><span class="special">,</span> <span class="identifier">velocity_type</span> <span class="special">&gt;</span>         <a name="boost.numeric.odeint.velocity_verlet.state_type"></a><span class="identifier">state_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span> <span class="identifier">velocity_type</span><span class="special">,</span> <span class="identifier">acceleration_type</span> <span class="special">&gt;</span> <a name="boost.numeric.odeint.velocity_verlet.deriv_type"></a><span class="identifier">deriv_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">state_wrapper</span><span class="special">&lt;</span> <span class="identifier">acceleration_type</span> <span class="special">&gt;</span>            <a name="boost.numeric.odeint.velocity_verlet.wrapped_acceleration_type"></a><span class="identifier">wrapped_acceleration_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">Value</span>                                         <a name="boost.numeric.odeint.velocity_verlet.value_type"></a><span class="identifier">value_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">Time</span>                                          <a name="boost.numeric.odeint.velocity_verlet.time_type"></a><span class="identifier">time_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">TimeSq</span>                                        <a name="boost.numeric.odeint.velocity_verlet.time_square_type"></a><span class="identifier">time_square_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">Resizer</span>                                       <a name="boost.numeric.odeint.velocity_verlet.resizer_type"></a><span class="identifier">resizer_type</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="identifier">stepper_tag</span>                                   <a name="boost.numeric.odeint.velocity_verlet.stepper_category"></a><span class="identifier">stepper_category</span><span class="special">;</span>
  <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">short</span>                                <a name="boost.numeric.odeint.velocity_verlet.order_type"></a><span class="identifier">order_type</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="velocity_verlet.html#boost.numeric.odeint.velocity_verletconstruct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="velocity_verlet.html#idm45671697460256-bb"><span class="identifier">velocity_verlet</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">algebra_type</span> <span class="special">&amp;</span> <span class="special">=</span> <span class="identifier">algebra_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="velocity_verlet.html#idm45671697516480-bb">public member functions</a></span>
  <span class="identifier">order_type</span> <a class="link" href="velocity_verlet.html#idm45671697515920-bb"><span class="identifier">order</span></a><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System<span class="special">,</span> <span class="keyword">typename</span> StateInOut<span class="special">&gt;</span>
    <span class="keyword">void</span> <a class="link" href="velocity_verlet.html#idm45671697513264-bb"><span class="identifier">do_step</span></a><span class="special">(</span><span class="identifier">System</span><span class="special">,</span> <span class="identifier">StateInOut</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">time_type</span><span class="special">,</span> <span class="identifier">time_type</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System<span class="special">,</span> <span class="keyword">typename</span> StateInOut<span class="special">&gt;</span>
    <span class="keyword">void</span> <a class="link" href="velocity_verlet.html#idm45671697504704-bb"><span class="identifier">do_step</span></a><span class="special">(</span><span class="identifier">System</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">StateInOut</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">time_type</span><span class="special">,</span> <span class="identifier">time_type</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System<span class="special">,</span> <span class="keyword">typename</span> CoorIn<span class="special">,</span> <span class="keyword">typename</span> VelocityIn<span class="special">,</span>
           <span class="keyword">typename</span> AccelerationIn<span class="special">,</span> <span class="keyword">typename</span> CoorOut<span class="special">,</span> <span class="keyword">typename</span> VelocityOut<span class="special">,</span>
           <span class="keyword">typename</span> AccelerationOut<span class="special">&gt;</span>
    <span class="keyword">void</span> <a class="link" href="velocity_verlet.html#idm45671697496144-bb"><span class="identifier">do_step</span></a><span class="special">(</span><span class="identifier">System</span><span class="special">,</span> <span class="identifier">CoorIn</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">VelocityIn</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span>
                 <span class="identifier">AccelerationIn</span> <span class="keyword">const</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">CoorOut</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">VelocityOut</span> <span class="special">&amp;</span><span class="special">,</span>
                 <span class="identifier">AccelerationOut</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">time_type</span><span class="special">,</span> <span class="identifier">time_type</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> StateIn<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="velocity_verlet.html#idm45671697481600-bb"><span class="identifier">adjust_size</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">StateIn</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="velocity_verlet.html#idm45671697477984-bb"><span class="identifier">reset</span></a><span class="special">(</span><span class="keyword">void</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> AccelerationIn<span class="special">&gt;</span> <span class="keyword">void</span> <a class="link" href="velocity_verlet.html#idm45671697475600-bb"><span class="identifier">initialize</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">AccelerationIn</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System<span class="special">,</span> <span class="keyword">typename</span> CoorIn<span class="special">,</span> <span class="keyword">typename</span> VelocityIn<span class="special">&gt;</span>
    <span class="keyword">void</span> <a class="link" href="velocity_verlet.html#idm45671697472480-bb"><span class="identifier">initialize</span></a><span class="special">(</span><span class="identifier">System</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">CoorIn</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">VelocityIn</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">time_type</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="velocity_verlet.html#idm45671697463072-bb"><span class="identifier">is_initialized</span></a><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="velocity_verlet.html#idm45671697457024-bb">private member functions</a></span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System<span class="special">,</span> <span class="keyword">typename</span> CoorIn<span class="special">,</span> <span class="keyword">typename</span> VelocityIn<span class="special">&gt;</span>
    <span class="keyword">void</span> <a class="link" href="velocity_verlet.html#idm45671697456448-bb"><span class="identifier">initialize_acc</span></a><span class="special">(</span><span class="identifier">System</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">CoorIn</span> <span class="special">&amp;</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">VelocityIn</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">time_type</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System<span class="special">,</span> <span class="keyword">typename</span> StateInOut<span class="special">&gt;</span>
    <span class="keyword">void</span> <a class="link" href="velocity_verlet.html#idm45671697450880-bb"><span class="identifier">do_step_v1</span></a><span class="special">(</span><span class="identifier">System</span><span class="special">,</span> <span class="identifier">StateInOut</span> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">time_type</span><span class="special">,</span> <span class="identifier">time_type</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> StateIn<span class="special">&gt;</span> <span class="keyword">bool</span> <a class="link" href="velocity_verlet.html#idm45671697445872-bb"><span class="identifier">resize_impl</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">StateIn</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">acceleration_type</span> <span class="special">&amp;</span> <a class="link" href="velocity_verlet.html#idm45671697443488-bb"><span class="identifier">get_current_acc</span></a><span class="special">(</span><span class="keyword">void</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">const</span> <span class="identifier">acceleration_type</span> <span class="special">&amp;</span> <a class="link" href="velocity_verlet.html#idm45671697441952-bb"><span class="identifier">get_current_acc</span></a><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">acceleration_type</span> <span class="special">&amp;</span> <a class="link" href="velocity_verlet.html#idm45671697440128-bb"><span class="identifier">get_old_acc</span></a><span class="special">(</span><span class="keyword">void</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">const</span> <span class="identifier">acceleration_type</span> <span class="special">&amp;</span> <a class="link" href="velocity_verlet.html#idm45671697438592-bb"><span class="identifier">get_old_acc</span></a><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="velocity_verlet.html#idm45671697436768-bb"><span class="identifier">toggle_current_acc</span></a><span class="special">(</span><span class="keyword">void</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// public data members</span>
  <span class="keyword">static</span> <span class="keyword">const</span> <span class="identifier">order_type</span> <span class="identifier">order_value</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="idm46706474482560"></a><h2>Description</h2>
<p><a href="http://en.wikipedia.org/wiki/Verlet_integration" target="_top">The Velocity-Verlet algorithm</a> is a method for simulation of molecular dynamics systems. It solves the ODE a=f(r,v',t) where r are the coordinates, v are the velocities and a are the accelerations, hence v = dr/dt, a=dv/dt.</p>
<p>
</p>
<div class="refsect2">
<a name="idm46706474480816"></a><h3>Template Parameters</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Coor</pre>
<p>The type representing the coordinates. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Velocity <span class="special">=</span> <span class="identifier">Coor</span></pre>
<p>The type representing the velocities. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Value <span class="special">=</span> <span class="keyword">double</span></pre>
<p>The type value type. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Acceleration <span class="special">=</span> <span class="identifier">Coor</span></pre>
<p>The type representing the acceleration. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Time <span class="special">=</span> <span class="identifier">Value</span></pre>
<p>The time representing the independent variable - the time. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> TimeSq <span class="special">=</span> <span class="identifier">Time</span></pre>
<p>The time representing the square of the time. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Algebra <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">algebra_dispatcher</span><span class="special">&lt;</span> <span class="identifier">Coor</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">algebra_type</span></pre>
<p>The algebra. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Operations <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">operations_dispatcher</span><span class="special">&lt;</span> <span class="identifier">Coor</span> <span class="special">&gt;</span><span class="special">::</span><span class="identifier">operations_type</span></pre>
<p>The operations type. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">typename</span> Resizer <span class="special">=</span> <span class="identifier">initially_resizer</span></pre>
<p>The resizer policy type. </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm46706474443840"></a><h3>
<a name="boost.numeric.odeint.velocity_verletconstruct-copy-destruct"></a><code class="computeroutput">velocity_verlet</code>
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><a name="idm45671697460256-bb"></a><span class="identifier">velocity_verlet</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">algebra_type</span> <span class="special">&amp;</span> algebra <span class="special">=</span> <span class="identifier">algebra_type</span><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre>Constructs the <code class="computeroutput"><a class="link" href="velocity_verlet.html" title="Class template velocity_verlet">velocity_verlet</a></code> class. This constructor can be used as a default constructor if the algebra has a default constructor. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">algebra</code></span></p></td>
<td><p>A copy of algebra is made and stored. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li></ol></div>
</div>
<div class="refsect2">
<a name="idm46706474428688"></a><h3>
<a name="idm45671697516480-bb"></a><code class="computeroutput">velocity_verlet</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="identifier">order_type</span> <a name="idm45671697515920-bb"></a><span class="identifier">order</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>Returns the order of the stepper. </p></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System<span class="special">,</span> <span class="keyword">typename</span> StateInOut<span class="special">&gt;</span>
  <span class="keyword">void</span> <a name="idm45671697513264-bb"></a><span class="identifier">do_step</span><span class="special">(</span><span class="identifier">System</span> system<span class="special">,</span> <span class="identifier">StateInOut</span> <span class="special">&amp;</span> x<span class="special">,</span> <span class="identifier">time_type</span> t<span class="special">,</span> <span class="identifier">time_type</span> dt<span class="special">)</span><span class="special">;</span></pre>This method performs one step. It transforms the result in-place. <p>It can be used like </p>
<pre class="programlisting"><span class="identifier">pair</span><span class="special">&lt;</span> <span class="identifier">coordinates</span> <span class="special">,</span> <span class="identifier">velocities</span> <span class="special">&gt;</span> <span class="identifier">state</span><span class="special">;</span>
<span class="identifier">stepper</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">)</span><span class="special">;</span>
</pre>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">dt</code></span></p></td>
<td><p>The step size. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">system</code></span></p></td>
<td><p>The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the Second Order System concept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">t</code></span></p></td>
<td><p>The value of the time, at which the step should be performed. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">x</code></span></p></td>
<td><p>The state of the ODE which should be solved. The state is pair of Coor and Velocity. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System<span class="special">,</span> <span class="keyword">typename</span> StateInOut<span class="special">&gt;</span>
  <span class="keyword">void</span> <a name="idm45671697504704-bb"></a><span class="identifier">do_step</span><span class="special">(</span><span class="identifier">System</span> system<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">StateInOut</span> <span class="special">&amp;</span> x<span class="special">,</span> <span class="identifier">time_type</span> t<span class="special">,</span> <span class="identifier">time_type</span> dt<span class="special">)</span><span class="special">;</span></pre>This method performs one step. It transforms the result in-place. <p>It can be used like </p>
<pre class="programlisting"><span class="identifier">pair</span><span class="special">&lt;</span> <span class="identifier">coordinates</span> <span class="special">,</span> <span class="identifier">velocities</span> <span class="special">&gt;</span> <span class="identifier">state</span><span class="special">;</span>
<span class="identifier">stepper</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">x</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">)</span><span class="special">;</span>
</pre>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">dt</code></span></p></td>
<td><p>The step size. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">system</code></span></p></td>
<td><p>The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the Second Order System concept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">t</code></span></p></td>
<td><p>The value of the time, at which the step should be performed. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">x</code></span></p></td>
<td><p>The state of the ODE which should be solved. The state is pair of Coor and Velocity. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System<span class="special">,</span> <span class="keyword">typename</span> CoorIn<span class="special">,</span> <span class="keyword">typename</span> VelocityIn<span class="special">,</span>
         <span class="keyword">typename</span> AccelerationIn<span class="special">,</span> <span class="keyword">typename</span> CoorOut<span class="special">,</span> <span class="keyword">typename</span> VelocityOut<span class="special">,</span>
         <span class="keyword">typename</span> AccelerationOut<span class="special">&gt;</span>
  <span class="keyword">void</span> <a name="idm45671697496144-bb"></a><span class="identifier">do_step</span><span class="special">(</span><span class="identifier">System</span> system<span class="special">,</span> <span class="identifier">CoorIn</span> <span class="keyword">const</span> <span class="special">&amp;</span> qin<span class="special">,</span> <span class="identifier">VelocityIn</span> <span class="keyword">const</span> <span class="special">&amp;</span> pin<span class="special">,</span>
               <span class="identifier">AccelerationIn</span> <span class="keyword">const</span> <span class="special">&amp;</span> ain<span class="special">,</span> <span class="identifier">CoorOut</span> <span class="special">&amp;</span> qout<span class="special">,</span>
               <span class="identifier">VelocityOut</span> <span class="special">&amp;</span> pout<span class="special">,</span> <span class="identifier">AccelerationOut</span> <span class="special">&amp;</span> aout<span class="special">,</span> <span class="identifier">time_type</span> t<span class="special">,</span>
               <span class="identifier">time_type</span> dt<span class="special">)</span><span class="special">;</span></pre>This method performs one step. It transforms the result in-place. Additionally to the other methods the coordinates, velocities and accelerations are passed directly to do_step and they are transformed out-of-place. <p>It can be used like </p>
<pre class="programlisting"><span class="identifier">coordinates</span> <span class="identifier">qin</span> <span class="special">,</span> <span class="identifier">qout</span><span class="special">;</span>
<span class="identifier">velocities</span> <span class="identifier">pin</span> <span class="special">,</span> <span class="identifier">pout</span><span class="special">;</span>
<span class="identifier">accelerations</span> <span class="identifier">ain</span><span class="special">,</span> <span class="identifier">aout</span><span class="special">;</span>
<span class="identifier">stepper</span><span class="special">.</span><span class="identifier">do_step</span><span class="special">(</span> <span class="identifier">sys</span> <span class="special">,</span> <span class="identifier">qin</span> <span class="special">,</span> <span class="identifier">pin</span> <span class="special">,</span> <span class="identifier">ain</span> <span class="special">,</span> <span class="identifier">qout</span> <span class="special">,</span> <span class="identifier">pout</span> <span class="special">,</span> <span class="identifier">aout</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">,</span> <span class="identifier">dt</span> <span class="special">)</span><span class="special">;</span>
</pre>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">dt</code></span></p></td>
<td><p>The step size. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">system</code></span></p></td>
<td><p>The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the Second Order System concept. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">t</code></span></p></td>
<td><p>The value of the time, at which the step should be performed. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> StateIn<span class="special">&gt;</span> <span class="keyword">void</span> <a name="idm45671697481600-bb"></a><span class="identifier">adjust_size</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">StateIn</span> <span class="special">&amp;</span> x<span class="special">)</span><span class="special">;</span></pre>Adjust the size of all temporaries in the stepper manually. <p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term"><code class="computeroutput">x</code></span></p></td>
<td><p>A state from which the size of the temporaries to be resized is deduced. </p></td>
</tr></tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idm45671697477984-bb"></a><span class="identifier">reset</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span><span class="special">;</span></pre>Resets the internal state of this stepper. After calling this method it is safe to use all <code class="computeroutput">do_step</code> method without explicitly initializing the stepper. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> AccelerationIn<span class="special">&gt;</span> <span class="keyword">void</span> <a name="idm45671697475600-bb"></a><span class="identifier">initialize</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">AccelerationIn</span> <span class="special">&amp;</span> ain<span class="special">)</span><span class="special">;</span></pre>Initializes the internal state of the stepper. <p>
</p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System<span class="special">,</span> <span class="keyword">typename</span> CoorIn<span class="special">,</span> <span class="keyword">typename</span> VelocityIn<span class="special">&gt;</span>
  <span class="keyword">void</span> <a name="idm45671697472480-bb"></a><span class="identifier">initialize</span><span class="special">(</span><span class="identifier">System</span> system<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">CoorIn</span> <span class="special">&amp;</span> qin<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">VelocityIn</span> <span class="special">&amp;</span> pin<span class="special">,</span>
                  <span class="identifier">time_type</span> t<span class="special">)</span><span class="special">;</span></pre>Initializes the internal state of the stepper. <p>This method is equivalent to </p>
<pre class="programlisting"><span class="identifier">Acceleration</span> <span class="identifier">a</span><span class="special">;</span>
<span class="identifier">system</span><span class="special">(</span> <span class="identifier">qin</span> <span class="special">,</span> <span class="identifier">pin</span> <span class="special">,</span> <span class="identifier">a</span> <span class="special">,</span> <span class="identifier">t</span> <span class="special">)</span><span class="special">;</span>
<span class="identifier">stepper</span><span class="special">.</span><span class="identifier">initialize</span><span class="special">(</span> <span class="identifier">a</span> <span class="special">)</span><span class="special">;</span>
</pre>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Parameters:</span></p></td>
<td><div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><code class="computeroutput">pin</code></span></p></td>
<td><p>The current velocities of the ODE. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">qin</code></span></p></td>
<td><p>The current coordinates of the ODE. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">system</code></span></p></td>
<td><p>The system function for the next calls of <code class="computeroutput">do_step</code>. </p></td>
</tr>
<tr>
<td><p><span class="term"><code class="computeroutput">t</code></span></p></td>
<td><p>The current time of the ODE. </p></td>
</tr>
</tbody>
</table></div></td>
</tr></tbody>
</table></div>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="idm45671697463072-bb"></a><span class="identifier">is_initialized</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>
</p>
<div class="variablelist"><table border="0" class="variablelist compact">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody><tr>
<td><p><span class="term">Returns:</span></p></td>
<td><p>Returns if the stepper is initialized. </p></td>
</tr></tbody>
</table></div>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="idm46706474211168"></a><h3>
<a name="idm45671697457024-bb"></a><code class="computeroutput">velocity_verlet</code> private member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System<span class="special">,</span> <span class="keyword">typename</span> CoorIn<span class="special">,</span> <span class="keyword">typename</span> VelocityIn<span class="special">&gt;</span>
  <span class="keyword">void</span> <a name="idm45671697456448-bb"></a><span class="identifier">initialize_acc</span><span class="special">(</span><span class="identifier">System</span> system<span class="special">,</span> <span class="keyword">const</span> <span class="identifier">CoorIn</span> <span class="special">&amp;</span> qin<span class="special">,</span>
                      <span class="keyword">const</span> <span class="identifier">VelocityIn</span> <span class="special">&amp;</span> pin<span class="special">,</span> <span class="identifier">time_type</span> t<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> System<span class="special">,</span> <span class="keyword">typename</span> StateInOut<span class="special">&gt;</span>
  <span class="keyword">void</span> <a name="idm45671697450880-bb"></a><span class="identifier">do_step_v1</span><span class="special">(</span><span class="identifier">System</span> system<span class="special">,</span> <span class="identifier">StateInOut</span> <span class="special">&amp;</span> x<span class="special">,</span> <span class="identifier">time_type</span> t<span class="special">,</span> <span class="identifier">time_type</span> dt<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> StateIn<span class="special">&gt;</span> <span class="keyword">bool</span> <a name="idm45671697445872-bb"></a><span class="identifier">resize_impl</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">StateIn</span> <span class="special">&amp;</span> x<span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">acceleration_type</span> <span class="special">&amp;</span> <a name="idm45671697443488-bb"></a><span class="identifier">get_current_acc</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">const</span> <span class="identifier">acceleration_type</span> <span class="special">&amp;</span> <a name="idm45671697441952-bb"></a><span class="identifier">get_current_acc</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="identifier">acceleration_type</span> <span class="special">&amp;</span> <a name="idm45671697440128-bb"></a><span class="identifier">get_old_acc</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">const</span> <span class="identifier">acceleration_type</span> <span class="special">&amp;</span> <a name="idm45671697438592-bb"></a><span class="identifier">get_old_acc</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li>
<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="idm45671697436768-bb"></a><span class="identifier">toggle_current_acc</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span><span class="special">;</span></pre></li>
</ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright &#169; 2009-2015 Karsten Ahnert and Mario Mulansky<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../../../header/boost/numeric/odeint/stepper/velocity_verlet_hpp.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../header/boost/numeric/odeint/stepper/velocity_verlet_hpp.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../../odeint/indexes.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
